/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.bean.User;
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.util.Util;
/*     */ import com.newcrm.webapi.sub.AddCustomerCategory;
/*     */ import com.newcrm.webapi.sub.DeleteCustomerCategory;
/*     */ import com.newcrm.webapi.sub.ListCustomerCategory;
/*     */ import com.newcrm.webapi.sub.UpdateCustomerCategory;
/*     */ import com.newcrm.webapi.sub.UpdateCustomerCatogorySort;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class CustomerCategory extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = -4704860501580542490L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  47 */     if (!checkLogin(request)) {
/*  48 */       super.showLoginPage(request, response);
/*  49 */       return;
/*     */     }
/*     */ 
/*  53 */     if (!super.getLoginUser(request).isAdmin) {
/*  54 */       request.getRequestDispatcher("/nopermission.jsp").forward(
/*  55 */         request, response);
/*  56 */       return;
/*     */     }
/*     */ 
/*  59 */     String url = request.getRequestURI();
/*  60 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*     */     try {
/*  62 */       if ((param == null) || (param.length == 0)) {
/*  63 */         String operation = Util.getURLParameter(request
/*  64 */           .getParameter("operation"));
/*  65 */         if ((operation == null) || (operation.trim().length() == 0)) {
/*  66 */           new ListCustomerCategory(this).parse(request, response);
/*  67 */           return;
/*     */         }
/*     */ 
/*  70 */         if ("sort".equals(operation)) {
/*  71 */           new UpdateCustomerCatogorySort(this).parse(request, 
/*  72 */             response);
/*  73 */           return;
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (NotFoundException e) {
/*  78 */       request.getRequestDispatcher("/errorpage.jsp").forward(request, 
/*  79 */         response);
/*  80 */       return;
/*     */     }
/*     */ 
/*  83 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/*  88 */     return new AddCustomerCategory(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/*  93 */     return new DeleteCustomerCategory(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/*  98 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 103 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 108 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 113 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 118 */     return null;
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 123 */     return "/customercategory";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 128 */     return new UpdateCustomerCategory(this, id);
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.CustomerCategory
 * JD-Core Version:    0.6.1
 */